package cn.cheln.explorer.ds.database.copersynch;

import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.provider.MediaStore.Audio.Media;
import cn.cheln.explorer.actions.OperationUtil;
import cn.cheln.explorer.beans.FileInfo;
import cn.cheln.explorer.beans.FileUtil;
import cn.cheln.explorer.ds.MediaArgs;
import cn.cheln.explorer.ds.util.ContentValuesUtil;
import cn.cheln.support.images.FileTypeInfo;
import cn.cheln.support.images.MimeTypeMap;
import cn.cheln.support.mobile.sdcard.SDcardChecker;
import java.io.File;

public class DatasrcPaste
{
  public static String updateCutCopyOnSingleFile(FileInfo paramFileInfo1, FileInfo paramFileInfo2, FileInfo paramFileInfo3, Context paramContext)
    throws IllegalStateException
  {
    String str1 = null;
    while (true)
    {
      label40: Uri localUri;
      ContentValues localContentValues;
      try
      {
        paramFileInfo1.buildName();
        String str2 = FileUtil.getRealExtension(paramFileInfo1.getName());
        str1 = null;
        if (str2 == null)
          break label585;
        if (str2.trim().equals(""))
        {
          break label585:
          boolean bool1 = paramFileInfo1.getFile().isDirectory();
          str1 = null;
          if (!(bool1))
            break label151;
        }
        for (localUri = MediaArgs.dirUri; ; localUri = MediaArgs.otherUri)
        {
          label151: boolean bool5;
          do
          {
            while (true)
              if (localUri != null)
              {
                localContentValues = ContentValuesUtil.constructContentValues(paramFileInfo1, FileTypeInfo.getTypeInfo(paramFileInfo1));
                if (OperationUtil.getOperType() == 1)
                  if (paramFileInfo1.overrideFlag == null)
                    if (localUri.equals(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI))
                    {
                      SDcardChecker.mediaUpdating = 1 + SDcardChecker.mediaUpdating;
                      paramContext.sendBroadcast(new Intent("android.intent.action.MEDIA_MOUNTED", Uri.fromFile(paramFileInfo1.getFile().getParentFile())));
                      return null;
                      str3 = MimeTypeMap.getSingleton().getMimeTypeFromExtension(str2.toLowerCase());
                      break label40:
                      if (str3 == null)
                        break label591;
                      boolean bool2 = str3.startsWith("image");
                      str1 = null;
                      if (bool2)
                      {
                        localUri = MediaArgs.ImageUri;
                        str1 = "image";
                      }
                      boolean bool3 = str3.startsWith("audio");
                      str1 = null;
                      if (bool3)
                      {
                        localUri = MediaArgs.AudioUri;
                        str1 = "audio";
                      }
                      boolean bool4 = str3.startsWith("video");
                      str1 = null;
                      if (bool4)
                      {
                        localUri = MediaArgs.VideoUri;
                        str1 = "video";
                      }
                      if (paramFileInfo2.getName().trim().toLowerCase().endsWith("apk"))
                      {
                        str1 = "apk";
                        localUri = MediaArgs.otherUri;
                      }
                      if ((str3.startsWith("application")) || (str3.startsWith("text")))
                      {
                        str1 = "doc";
                        localUri = MediaArgs.otherUri;
                      }
                    }
              }
            bool5 = paramFileInfo2.name.trim().toLowerCase().endsWith("lwt");
            str1 = null;
            localUri = null;
          }
          while (!(bool5));
          str1 = "lewa/theme";
        }
        paramContext.getContentResolver().insert(localUri, localContentValues);
        break label593:
        ContentResolver localContentResolver4 = paramContext.getContentResolver();
        String[] arrayOfString4 = new String[1];
        arrayOfString4[0] = paramFileInfo1.getPath();
        localContentResolver4.update(localUri, localContentValues, "_data like ?", arrayOfString4);
      }
      catch (Exception localException)
      {
        localException.printStackTrace();
      }
      break label593:
      if (OperationUtil.getOperType() != 0)
        break label593;
      if ((paramFileInfo1.overrideFlag != null) && (paramFileInfo1.overrideFlag.booleanValue()))
      {
        if (localUri.equals(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI))
          paramContext.sendBroadcast(new Intent("android.intent.action.MEDIA_MOUNTED", Uri.parse("file://" + paramFileInfo3.path)));
        while (true)
        {
          ContentResolver localContentResolver3 = paramContext.getContentResolver();
          String[] arrayOfString3 = new String[1];
          arrayOfString3[0] = paramFileInfo1.getPath();
          localContentResolver3.update(localUri, localContentValues, "_data like ?", arrayOfString3);
          break label593:
          ContentResolver localContentResolver2 = paramContext.getContentResolver();
          String[] arrayOfString2 = new String[1];
          arrayOfString2[0] = paramFileInfo3.getPath();
          localContentResolver2.delete(localUri, "_data like ?", arrayOfString2);
        }
      }
      ContentResolver localContentResolver1 = paramContext.getContentResolver();
      String[] arrayOfString1 = new String[1];
      arrayOfString1[0] = paramFileInfo3.getPath();
      localContentResolver1.update(localUri, localContentValues, "_data like ?", arrayOfString1);
      break label593:
      label585: String str3 = null;
    }
    label591: return null;
    label593: return str1;
  }
}

/* Location:           H:\360云盘\lewa_explorer_3.0\bin\FileApp_orig_dex2jar.jar
 * Qualified Name:     cn.cheln.explorer.ds.database.copersynch.DatasrcPaste
 * JD-Core Version:    0.5.2
 */